package org.terramagnet.mvcframework.http.signature.impl;

import org.terramagnet.mvcframework.http.signature.Signer;

/**
 * 需要秘钥的签名方法.
 *
 * @author lip
 */
public abstract class AbstractSecretSigner implements Signer {

    private String secret;
    private String name = "sign";

    /**
     * 秘钥.
     */
    protected String secret() {
        return secret;
    }

    @Override
    public Signer secret(String secret) {
        this.secret = secret;
        return this;
    }

    /**
     * 设置签名参数名.
     */
    protected Signer name(String name) {
        this.name = name;
        return this;
    }

    @Override
    public String name() {
        return name;
    }
}
